import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class Test04 extends StatefulWidget {
  @override
  _Test04State createState() => _Test04State();
}

class _Test04State extends State<Test04> {
  var radioValue="1";
  var groupValue="2";

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Radio(
          value: radioValue,
          groupValue: groupValue,
          onChanged: (value) {
            print(value);
            setState(() {
              groupValue = value;
            });
          }),
    );
  }
}
